package com.example.poverty.service.impl;

import com.example.poverty.dao.OrganizationDepartmentMapper;
import com.example.poverty.entity.OrganizationDepartment;
import com.example.poverty.service.OrganizationDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 前端  主管单位  接口实现
 */
@Service
public class OrganizationDepartmentServiceImpl implements OrganizationDepartmentService {

    @Autowired
    private OrganizationDepartmentMapper organizationDepartmentMapper;

    @Override
    public boolean insert(OrganizationDepartment organizationDepartment) {
        return organizationDepartmentMapper.insert(organizationDepartment) > 0;
    }

    @Override
    public boolean update(OrganizationDepartment organizationDepartment) {
        return organizationDepartmentMapper.update(organizationDepartment) > 0;
    }

    @Override
    public boolean delete(Integer id) {
        return organizationDepartmentMapper.delete(id) > 0;
    }

    @Override
    public OrganizationDepartment selectByPrimaryKey(Integer id) {
        return organizationDepartmentMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<OrganizationDepartment> allOrganizationDepartment() {
        return organizationDepartmentMapper.allOrganizationDepartment();
    }

    @Override
    public OrganizationDepartment getByUnit(String unit) {
        return organizationDepartmentMapper.getByUnit(unit);
    }
}
